$OpenBSD: patch-makefiles_Makefile_top,v 1.4 2016/01/16 09:04:13 bentley Exp $
--- makefiles/Makefile.top.orig	Fri Dec 18 02:38:25 2015
+++ makefiles/Makefile.top	Fri Jan 15 11:54:05 2016
@@ -187,8 +187,8 @@ endif
 ifeq ($(findstring lib,$(COMPONENT_TYPE)),lib)
   ifeq ($(findstring lib-shared,$(COMPONENT_TYPE)),lib-shared)
     SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
-    SONAME := $(SHAREDLIBNAME).$(major-version)
-    OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(COMPONENT_VERSION)
+    SONAME := $(SHAREDLIBNAME).$(NS_LIB_VERSION)
+    OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(NS_LIB_VERSION)
   else
     OUTPUT := $(BUILDDIR)/lib$(COMPONENT)$(LIBEXT)
   endif
@@ -203,14 +203,6 @@ endif
 .PHONY: all test coverage profile docs clean distclean install uninstall \
 	__default __precov __partial_clean __postshared
 
-ifeq ($(COMPONENT_TYPE),lib-shared)
-  POST_TARGETS := __postshared $(POST_TARGETS)
-
-__postshared:
-	$(Q)$(LN) $(LNFLAGS) -f -s $(notdir $(OUTPUT)) $(BUILDDIR)/$(SONAME)
-	$(Q)$(LN) $(LNFLAGS) -f -s $(notdir $(OUTPUT)) $(BUILDDIR)/$(SHAREDLIBNAME)
-endif
-
 # Default target
 all: $(PRE_TARGETS) $(OUTPUT) $(POST_TARGETS)
 
@@ -289,7 +281,7 @@ __libraries = $(if $(REQUIRED_LIBS),-l$(subst $(__spac
 define install_pkgconfig
 	$(Q)$(ECHO) $(ECHOFLAGS) "sed -e... $1 >$(BUILDDIR)/$(1:.in=)"
 	$(Q)$(SED) \
-		-e 's#PREFIX#$(PREFIX)#' \
+		-e 's#PREFIX#$(TRUEPREFIX)#' \
 		-e 's#LIBDIR#$(LIBDIR)#' \
 		-e 's#MAJOR#$(major-version)#' \
 		-e 's#MINOR#$(minor-version)#' \
@@ -307,8 +299,6 @@ endef
 # TODO: Is this scheme portable?
 define install_shared_lib
   $(INSTALL) $(INSTALLFLAGS) -m 755 $1 $2/$(notdir $1)
-  $(LN) $(LNFLAGS) -f -s $(notdir $1) $2/$(SONAME)
-  $(LN) $(LNFLAGS) -f -s $(notdir $1) $2/$(SHAREDLIBNAME)
 
 endef
 
